Runtime fusion of operators based on processing element workload threshold and programming instruction compatibility

ABSTRACT

The streams environment includes a plurality of operators coupled with processing elements including a first processing element coupled with a first operator instructed with a first programming instructions, and a second processing element coupled with a second operator instructed with a second programming instructions. A workload of the first processing element and a workload of the second processing element are measured. A first threshold of the workload of the first processing element, and second threshold of the workload of the second processing element are determined. The first programming instructions and the second programming instructions are compared to determine if the first operator and the second operator are susceptible to fusion. The first operator is de-coupled and fused to the second processing element, in response to determining the first threshold and the determination that the first operator and the second operator are susceptible to fusion.

BACKGROUND

This disclosure generally relates to stream computing, and inparticular, to computing applications that receive streaming data andprocess the data as it is received.

Database systems are typically configured to separate the process ofstoring data from accessing, manipulating, or using data stored in adatabase. More specifically, database systems use a model in which datais first stored and indexed in a memory before subsequent querying andanalysis. In general, database systems may not be well suited forperforming real-time processing and analyzing streaming data. Inparticular, database systems may be unable to store, index, and analyzelarge amounts of streaming data efficiently or in real time.

SUMMARY

Embodiments of the disclosure provide a method, system, and computerprogram product for processing data. The method, system, and computerprogram product receive two or more tuples to be processed by aplurality of processing elements operating on one or more computerprocessors.

One embodiment provides a method for determining a fusion of two or moreoperators. The streams environment includes one or more computerprocessors. The streams environment includes a plurality of operatorscoupled with processing elements including a first processing elementcoupled with a first operator instructed with a first programminginstructions, and a second processing element coupled with a secondoperator instructed with a second programming instructions. A workloadof the first processing element and a workload of the second processingelement are measured. A first threshold of the workload of the firstprocessing element, and second threshold of the workload of the secondprocessing element are determined. The first programming instructionsand the second programming instructions are compared to determine if thefirst operator and the second operator are susceptible to fusion. Thefirst operator is de-coupled and fused to the second processing element,in response to determining the first threshold and the determinationthat the first operator and the second operator are susceptible tofusion.

Another embodiment is directed toward a system for determining thefusion of a plurality of operators within a streaming environment. Thesystem includes a memory, and a processor device communicatively coupledto the memory. The streams manager is configured to monitor theplurality of operators within the streams environment. The streamsmanager is configured to monitor the streams environment including aplurality of operators coupled with processing elements including afirst processing element coupled with a first operator instructed with afirst programming instructions, and a second processing element coupledwith a second operator instructed with a second programminginstructions. The streams manager is configured to measure a workload ofthe first processing element and a workload of the second processingelement. The streams manager is configured to determine a firstthreshold of the workload of the first processing element, and secondthreshold of the workload of the second processing element aredetermined. The streams manager is configured to determine if the firstoperator and the second operator are susceptible to fusion by comparingthe first programming instructions and the second programminginstructions. The streams manager is configured to de-couple and fusethe first operator to the second processing element, in response todetermining the first threshold and the determination that the firstoperator and the second operator are susceptible to fusion.

Yet another embodiment is directed toward a computer program product fordetermining the fusion of a plurality of operators within a streamingenvironment. The computer program product is configured to monitor theplurality of operators within the streams environment. The computerprogram product is configured to monitor the streams environmentincluding a plurality of operators coupled with processing elementsincluding a first processing element coupled with a first operatorinstructed with a first programming instructions, and a secondprocessing element coupled with a second operator instructed with asecond programming instructions. The computer program product isconfigured measure a workload of the first processing element and aworkload of the second processing element. The computer program productis configured to determine a first threshold of the workload of thefirst processing element, and second threshold of the workload of thesecond processing element are determined. The computer program productis configured to determine if the first operator and the second operatorare susceptible to fusion by comparing the first programminginstructions and the second programming instructions. The computerprogram product is configured to de-couple and fuse the first operatorto the second processing element, in response to determining the firstthreshold and the determination that the first operator and the secondoperator are susceptible to fusion.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates a computing infrastructure configured to execute astream computing application, according to various embodiments.

FIG. 2 illustrates a more detailed view of a compute node of FIG. 1,according to various embodiments.

FIG. 3 illustrates a more detailed view of the management system of FIG.1, according to various embodiments.

FIG. 4 illustrates a more detailed view of the development system ofFIG. 1, according to various embodiments.

FIG. 5 illustrates an operator graph for a stream computing application,according to various embodiments.

FIG. 6A illustrates an operator graph of plurality of processingelements within a streams environment, according to various embodiments.

FIG. 6B illustrates an operator graph where two processing elements eachwith a plurality of operators have fused operators into one processingelement containing the plurality of operators, according to variousembodiments.

FIG. 7A illustrates an operator graph with three processing elementsincluding operators associated with the processing elements, accordingto various embodiments.

FIG. 7B illustrates an operator graph where two processing elements havebeen fused by a distribution of operators, according to variousembodiments.

FIG. 8 illustrates a flowchart determining the fusion of a firstoperator and a second operator onto a single processing element,according to various embodiments.

While the invention is amenable to various modifications and alternativeforms, specifics thereof have been shown by way of example in thedrawings and will be described in detail. It should be understood,however, that the intention is not to limit the invention to theparticular embodiments described. On the contrary, the intention is tocover all modifications, equivalents, and alternatives falling withinthe spirit and scope of the invention.

DETAILED DESCRIPTION

Aspects of the present disclosure relate to a streams environment, moreparticular aspects relate to runtime fusion of two or more operators.While the present disclosure is not necessarily limited to suchapplications, various aspects of the disclosure may be appreciatedthrough a discussion of various examples using this context.

Stream-based computing and stream-based database computing are emergingas a developing technology for database systems. Products are availablethat allow users to create applications that process and query streamingdata before it reaches a database file. With this emerging technology,users may specify processing logic to apply to inbound data recordswhile they are “in flight,” with the results available in a very shortamount of time, often in fractions of a second. Constructing anapplication using this type of processing has opened up a newprogramming paradigm that will allow for development of a broad varietyof innovative applications, systems, and processes, as well as presentnew challenges for application programmers and database developers.

In a stream computing application, stream operators are connected to oneanother such that data flows from one stream operator to the next (e.g.,over a TCP/IP socket). When a stream operator receives data, it mayperform operations, such as analysis logic, which may change the tupleby adding or subtracting attributes, or updating the values of existingattributes within the tuple. When the analysis logic is complete, a newtuple is then sent to the next stream operator. Scalability is achievedby distributing an application across nodes by creating executables(i.e., processing elements), as well as replicating processing elementson multiple nodes and load balancing among them. Stream operators in astream computing application may be fused together to form a processingelement that is executable. Doing so allows processing elements to sharea common process space, resulting in much faster communication betweenstream operators than is available using inter-process communicationtechniques (e.g., using a TCP/IP socket). Further, processing elementsmay be inserted or removed dynamically from an operator graphrepresenting the flow of data through the stream computing application.A particular stream operator may not reside within the same operatingsystem process as other stream operators. In addition, stream operatorsin the same operator graph may be hosted on different nodes, e.g., ondifferent compute nodes or on different cores of a compute node.

A compute node may include a computer processor. The computer processormay operate along with one or more other computer processors, forming agrouping. The grouping of two or more computer processors may be termedas a cluster, e.g., a server containing one or more computer processors,on which the streams environment operates.

Data flows from one stream operator to another in the form of a “tuple.”A tuple is a sequence of one or more attributes associated with anentity. Attributes may be any of a variety of different types, e.g.,integer, float, Boolean, string, etc. The attributes may be ordered. Inaddition to attributes associated with an entity, a tuple may includemetadata, i.e., data about the tuple. A tuple may be extended by addingone or more additional attributes or metadata to it. As used herein,“stream” or “data stream” refers to a sequence of tuples. Generally, astream may be considered a pseudo-infinite sequence of tuples.

Tuples are received and output by stream operators and processingelements. An input tuple corresponding with a particular entity that isreceived by a stream operator or processing element, however, may bechanged by the stream operator, even if the output tuple correspondswith the same entity or data as the input tuple. An output tuple neednot be changed in some way from the input tuple.

Nonetheless, an output tuple may be changed in some way by a streamoperator or processing element. An attribute or metadata may be added,deleted, or modified. For example, a tuple will often have two or moreattributes. A stream operator or processing element may receive thetuple having multiple attributes and output a tuple corresponding withthe input tuple. The stream operator or processing element may onlychange one of the attributes so that all of the attributes of the outputtuple, except one, are the same as the attributes of the input tuple.

Generally, a particular tuple output by a stream operator or processingelement may not be considered to be the same tuple as a correspondinginput tuple even if the input tuple is not changed by the processingelement. However, the run environment of the present description and theclaims, may include an output tuple that has the same data attributes oris associated with the same entity as a corresponding input tuple whichwill be referred to herein as the same tuple unless the context or anexpress statement indicates otherwise.

Streams environments may include a distributed programming paradigmwhere an application may be split up into pieces. The pieces of theapplication may be distributed across a series of processing elements.The series of processing elements may run on one or more computerprocessors within a cluster of the streams environment. The processingelements may be connected together by sending streams of data or tuplesinto and out of an initial processing element to a subsequent processingelement. The stream may include a series of tuples each of which mayhave attributes. The tuples may enter the processing elements one tupleat a time. Contracts may exist between processing elements to whichprocessing elements who sends the tuples and which processing elementsreceive tuples. The stream of tuples may be introduced continuously,(i.e. never ending) the processes main thread code may include a callback routine that executes when tuples arrive at any of the incomingports.

The processing elements of the streams environment may include aplurality of operators configured to perform various tasks upon thetuples. The plurality of operators may be grouped together to form aprocessing element that performs the task as a whole using the pluralityof operators. Alone, an operator may perform a single task upon a tuple,whereas if the operators are grouped together, multiple tasks may becompleted by a single processing element in tandem. For example, twooperators may operate within a single processing element. The twooperators may perform two tasks or operations upon the tuplesimultaneously while the tuple is within the single processing element.

Operator graphs may include one or more processing elements aligned toperform a function upon one or more tuples as the tuples pass throughthe stream environment. Operator graphs may be basic or complex. Basicoperator graphs may include a few operators configured to perform asimple task. For example, a basic operator graph may include threeprocessing elements. The three processing elements may include a source,a functor, and a sink. The source may input tuples into the stream, thefunctor may perform an operation upon the tuples sent from the source,and the sink may output the tuples from the stream. The source may readexternal data from a file or socket using a uniform resource identifier(URI). For example, the source may read external data from a first diskand pass the data in a form of tuples read from the disk to the functor.The functor may perform a manipulation or transformation operation,where an attribute of a tuple may be changed. The functor may be aprocessing element. The processing element may perform an operation uponthe tuple, described further herein. The sink may intake the tuple,write the tuple, and externalize the tuple onto a desired output format.For example, the sink may write the tuple to a disk, the tuple mayinclude the data transformed by the functor. The data can beexternalized and displayed on a graphical user interface (GUI)observable by an end user.

Operator graphs may also be complex. Complex operator graphs may includeone or more processing elements, operating on one or more tuples, withinthe streams environment. For example, the operator graph may include asplit operator. The split operator may copy the tuples to run the splittuples in tandem within separate processing elements. For example, afirst tuple is split into a first tuple and a copy of the first tuple.The first tuple may enter a first set of one or more processing elementswithin the operator graph, and the copy of the first tuple may enter asecond set of one or more processing elements within the operator graph.The first set of one or more processing elements may perform a first setof operations upon the first tuple, while the second set of one or moreprocessing elements may perform a second set of operations upon the copyof the first tuple.

Each operator may turn into a processing element and include a separateprocess compared to other operators. Having each operator operate uponindividual processing elements may spread out the workload, using one ormore computer processors, within the streams environment. The one ormore computer processors may operate within a cluster of computerprocessors that are configured to run the streams environment. Theprocessing elements including a single operator may not utilizeavailable processing power within the computer processor depending uponthe operator and the computer processor utilized by the operator. Toincrease the efficiency of the processing power available within thecluster of computer processors, operators may be fused alongside otheroperators within a single processing element.

Operators may include code that instructs the operators to performactions upon tuples as they pass though the operators. The code may bewritten using a particular programming language to create programinstructions for the operators. The operators may be combined intoprocessing elements that use the computers processors of the streamsenvironment to perform the operations upon the tuples. One or moreoperators may be programmed or grouped to a single processing element,causing a single processing element to be able to perform multiple tasksor operations. To process the tuples, the one or more processingelements require processing power of the one or more computer processorsof the cluster. If the one or more operators do not require all of theprocessing power available from a computer processor, then additionaloperators may be fused to the processing element. Fusing an additionaloperator to a processing element may better utilize the processing powerof the computer processor.

In various embodiments, the programming instructions of the operator mayalso include instructions on fusion. The fusion instructions may includea determination if an operator is susceptible to fusion. Fusionsusceptibility may include whether or not the operator may fuse withinany other operator, which one or more operators the operator may fuse,or which one or more operators the operator may not fuse. Theinstructions for fusion will be described further herein. In determiningif the fusion of two operators may be possible, a fusion manager may usethe programming instructions to determine if the two operators asusceptible to fusion used interchangeably with susceptibility to fusionfurther herein. For example, the fusion manager may compare a fusioncompatibility of a first operator and a second operator. Programminginstructions of the first operator and Programming instructions of thesecond operator may be compared as a fusion compatibility. If theprogramming instructions of the first operator and the programminginstructions of the second operator are compatible, then the firstoperator and the second operator may be fused together on a processingelement.

In various embodiments, the fusion of two or more operators may bedetermined by a class (i.e. type) of the operators. The class of theoperator may be included within the programming instructions of theoperators. If two operators are the same class, then they may be fused.A first operator with a first class may be able to fuse with a secondoperator with the first class. The class of the programming instructionsmay include sorting the types of operators into groups that preform asimilar function. For example, two filter operators may be the sameclass because they both preform a filtering operation. The two filteroperators may be fused together because they are the same operatorclass.

The streams environment including the operator graph may also include afusion manager. The fusion manager may fuse together two or moreoperators included within two or more processing elements into a singleprocessing element. The fusion manager may be a streams profiler thatmonitors the workload of the processing elements within the stream. Thefusion manager may also be communicatively coupled with a streamsmanager that performs various functions on the streams environment. Forexample, the single processing element may include a single executableor deployable piece of code. The single executable may take up thesingle processing element. The reduction of the two or more processingelements running may increase the performance of the streamsenvironment. The performance perspective may include the processingpower of the one or more computer processors within the cluster. Forexample, reducing the number of processing elements may reduce thenumber of computer processors that are used to send data in and out ofthe processing elements. The one or more processing elements maycommunicate over transmission control protocol/internet protocol(TCP/IP) by ordering attributes from one processing element to another.If the one or more operators are fused then the communications betweenthe operators may be similar to a “function call” in computerprogramming.

Fusion information may be located within sections of the programminginstructions or code. The programming instructions may be used by thefusion manager to determine fusion points. The fusion of the operatorsmay be determined by the fusion manager and may be used to determine anincrease or decrease in efficiency of the stream by fusing a pluralityof operators. However, performing the determination during compile timemay include limitations. An example of a limitation may include, withoutdoing runtime analysis, the fusion manager may have a decreasedunderstanding of the location of the operators within the processingelements within the stream. Whereas if the determination of the fusionpoints is performed during run time, may allow the fusion manager tolocate the operators within the processing elements, and monitor thecurrent efficiency of the processing elements.

Although the combination of multiple operators within a singleprocessing element may decrease the amount of computer processors of thecluster needed to operate the streams environment, loading all of theoperators onto a single processing element may overload the computerprocessors. To prevent a computer processor from becoming overloaded,the operators may be balanced. To determine if a computer processor isoverloaded, an upper threshold may be used. For example, if fiveoperators exist within the operator graph each of the five operators maycontain various tasks. Of the five operators, operators that aresimilarly tasked may be grouped upon a single processing element, andoperators that are specifically tasked may remain on their ownprocessing element. In an example, three of the five operators aresimilarly tasked and two of the operators are specifically tasked. Ifthe first operator, the third operator, and the fourth operator aresimilarly tasked and able to be grouped, then they may be grouped ontothe first processing element as long as first processing element doesnot require too much processing power. The second operator may be placedon a second processing element, and the fifth operator may be placedupon a third processing element. A maximum throughput or speed ofprocessing of the data stream may be determined by how much processingpower the processing element requires, or how efficiently the operatorsare distributed upon the processing elements.

A limitation of fusing a plurality of operators may include too manyoperators of a processing element running on a single computerprocessor. To prevent a computer processor from being overloaded, astreams manager may monitor the stream in real time. The streams managermay communicate with the fusion manager. The fusion manager may analyzethe code of the operators as the operators perform operations upon thetuples. The fusion manager may also fuse operators from a firstprocessing element to a second processing element to reduce the overallnumber of processes running on a given computer processor withoutchanging an end result of the stream. By reducing the amount ofprocessing elements, more jobs may executed on a single computerprocessor without overburdening the system.

The streams manager may perform a runtime analysis of the currentoperations running within the streams environment. The runtime analysismay include monitoring the plurality of operators of a processingelement. The operators may perform operations upon tuples within thestreams environment. The streams manager may use information gathered bymonitoring the processing element to determine if fusion of an operatorwith the plurality of operators of the processing element may be done.

To prevent the computer processors from being overloaded or underloaded,a plurality of operators may be fused or transferred from a firstprocessing element to a second processing element. Code or programminginstructions within the operators may be used to determine whichoperators may be fused together within the same processing element. Away to increase the efficiency of the operator graph may includereducing the amount of processing elements within the stream, which maydecrease the amount of transfers from a processing element to anotherprocessing element. For example, one data stream has ten processingelements with one hundred operators, and another stream has fiveprocessing elements with the same one hundred operators. The stream withfive processing elements may have a shorter processing time of thestream because of the reduction of the number of transfers fromprocessing element to processing element.

To prevent a computer processor from being overloaded or underloaded,thresholds may be incorporated. An upper threshold may be placed upon aworkload of a processing element to prevent the computer processorrunning the processing element from being overloaded. For example, morethan one operators may be operating upon a first processing element. Ifthe combined workload of the plurality of operators within theprocessing element reaches the upper threshold, then the processingelement may be overloaded. A lower threshold may be placed upon theworkload of the processing element to prevent the computer processorrunning the processing element from being underloaded. For example, morethan one operators may be operating upon a first processing element. Ifthe combined workload of the plurality of operators within theprocessing element reaches the lower threshold, then the processingelement may be underloaded. Thresholds relating to the workload ofprocessing elements will be described further herein.

The workload may contain runtime statistics of the processing element.Runtime statistics may include the workloads of the operators within theprocessing element. Runtime statistics may be used to display theworkload to the operators, and be stored as historical information. Thehistorical information may include the previous operations theprocessing element performed. The historical information may include theprevious fusion of the operators within the processing element. Forexample, the runtime statistics can be stored of a first processingelement. The first processing element may contain a first operator and asecond operator that were fused. The first processing element mayinclude the historical information of the first operator and the secondoperator. The workload of the first operator and the workload of thesecond operator can be combined and future workloads of the firstoperator and second operator can be recorded.

The applications running within the streams environment may be monitoredto determine if one or more operators may be fused together. Todetermine if the one or more operators may be fused, throughput timesmay be used. The throughput times may include the movement of tuplesthroughout the streams environment. If an operator is slowing down aprocessing time of a processing element, then the operator may be placedelsewhere within the streams environment. For example, if first operatoris slowing down the processing time of a first processing element thefirst operator may be de-coupled from the first processing element. Thefirst operator may then be fused with a second processing element, orthe first operator may be made into a singular second processingelement, where the singular second processing element only contains thefirst operator.

In various embodiments, the fusion manager may monitor processingelements after fusion. The fusion manager may monitor the one or moreprocessing elements that were involved in the fusion and determine ifthe fusion was successful or unsuccessful. A successful fusion couldinclude completing the intended result based on the reason fororiginally fusing the one or more operators. For example, a firstoperator may be fused to a second processing element because theworkload of the first processing element originally containing the firstoperator was overloaded. If the fusion of the first operator to thesecond processing element decreased the workload of the first processingelement, then the fusion may be deemed successful. An unsuccessfulfusion could include not completing the intended result based on thereason for originally fusing the one or more operators. For example, afirst operator may be fused to a second processing element because theworkload of the first processing element originally containing the firstoperator was overloaded. If the fusion of the first operator to thesecond processing element increased the workload of the first processingelement, then the fusion may be deemed unsuccessful.

In various embodiments, the fusion manager may store history of previousruns on the application of the streams environment. The history ofprevious runs may include the workloads of one or more operators withinthe operator graph of the streams environment. The workloads of theplurality of operators may be gathered by the processing element withinthe streams environment and displayed upon a GUI. The history of theworkloads of the plurality of operators may be used to determine fusionpoints of the plurality of operators within one or more processingelements. The history of the workloads may be used by the fusion manageror an end user to determine fusion points of the operators.

In various embodiments, the fusion of one or more operators may be usedto decrease the overall workload of the stream environment. The fusionof the one or more operators may free up computer processor space withinthe cluster of the streams environment. If one or more operators arefused onto a single processing element the amount of computer processorsbeing operated upon by the streams environment may be decreased,reducing the required processing power of the stream. For example, afirst processing element and a second processing element each running ona separate computer processor are fused. The first processing elementleaves a first computer processor the first processing element isrunning on, and fuses with the second processing element on a secondcomputer processor. The first computer processor may no longer berunning a processing element.

In various embodiments, the fusion one or more operators may be used todecrease the workload of a single processing element. The fusion of oneor more operators of two different processing elements may decrease theworkload of at least one of the processing elements. Processing elementsrequiring more processing power than others may be considered overloadedwhen compared to other processing elements. For example, a firstprocessing element may require an increased amount or more processingpower when compared to a second processing element. The first processingelement may contain one or more operators that are able to betransferred to the second processing element. The one or more operatorsmay be transferred from the first processing element to the secondprocessing element. After decreasing the amount of operators within thefirst processing element, the first processing element may require lessprocessing power than previously.

In various embodiments, the fusion one or more operators may be used toincrease the workload of a single processing element. The fusion ofoperators of two processing elements may increase the workload of one ofthe processing elements. Processing elements requiring less processingpower than others may be considered underloaded when compared to otherprocessing elements. For example, a first processing element may requirea decreased amount of processing power compared to a second processingelement. If the first processing element contains one or more operatorsthat contain the programming instructions to be transferred to thesecond processing element, then the one or more operators may betransferred from the first processing element to the second processingelement. After increasing the amount of operators within the secondprocessing element, the second processing element may require moreprocessing power than originally.

In various embodiments, an operator within a processing element may beconfigured to not fuse with another operator and the configuration ofthe operator may not allow a subsequent operator to perform an actionalongside the operator. For example, a split operator operating as aprocessing element may not fuse with another operator unless the splitprocessing element is programmed to do so. Because the split processingelement may be configured to split a single tuple into two tuples, theoperators required to perform the split operation may be within thesplit processing element. If the split processing element was coded tofuse with operators containing a certain programming instructions, thenunless an operator has the certain programming instructions, the splitprocessing element may not join with the operator.

FIG. 1 illustrates one exemplary computing infrastructure 100 that maybe configured to execute a stream computing application, according tosome embodiments. The computing infrastructure 100 includes a managementsystem 105 and two or more compute nodes 110A-110D—i.e., hosts—which arecommunicatively coupled to each other using one or more communicationsnetworks 120. The communications network 120 may include one or moreservers, networks, or databases, and may use a particular communicationprotocol to transfer data between the compute nodes 110A-110D. Adevelopment system 102 may be communicatively coupled with themanagement system 105 and the compute nodes 110 either directly or viathe communications network 120.

The management system may include an operator graph 132, a streammanager 134, and a fusion manager 140. The operator graph 132 mayinclude the instructions of the ordering of a plurality of processingelements of the streams environment. The operator graph 132 may orderthe plurality of processing elements based on the function of thestreams environment. The stream manager 134 may include instructions tomonitor functions of the streams environment. The stream manager 134 maycollect information of tuples, operators, and processing elements of thestreams environment. The stream manager 134 may determine operations tobe performed on the operator graph depending on the collectedinformation. The fusion manager 140 may collect information of tuples,operators, and processing elements of the streams environment. Thefusion manager 140 may fuse operators within the streams environment.The fusion of operators may include removing operators from processingelements, and fusing the operators to other processing elements based onthe collected information.

The communications network 120 may include a variety of types ofphysical communication channels or “links.” The links may be wired,wireless, optical, or any other suitable media. In addition, thecommunications network 120 may include a variety of network hardware andsoftware for performing routing, switching, and other functions, such asrouters, switches, or bridges. The communications network 120 may bededicated for use by a stream computing application or shared with otherapplications and users. The communications network 120 may be any size.For example, the communications network 120 may include a single localarea network or a wide area network spanning a large geographical area,such as the Internet. The links may provide different levels ofbandwidth or capacity to transfer data at a particular rate. Thebandwidth that a particular link provides may vary depending on avariety of factors, including the type of communication media andwhether particular network hardware or software is functioning correctlyor at full capacity. In addition, the bandwidth that a particular linkprovides to a stream computing application may vary if the link isshared with other applications and/or users. The available bandwidth mayvary depending on the load placed on the link by the other applicationsand users. The bandwidth that a particular link provides may also varydepending on a temporal factor, such as time of day, day of week, day ofmonth, or season.

FIG. 2 is a more detailed view of a compute node 110, which may be thesame as one of the compute nodes 110A-110D of FIG. 1, according tovarious embodiments. The compute node 110 may include, withoutlimitation, one or more processors (CPUs) 205, a network interface 215,an interconnect 220, a memory 225, and a storage 230. The compute node110 may also include an I/O device interface 210 used to connect I/Odevices 212, e.g., keyboard, display, stylus, touchscreen, and mousedevices, to the compute node 110.

Each CPU 205 retrieves and executes programming instructions stored inthe memory 225 or storage 230. Similarly, the CPU 205 stores andretrieves application data residing in the memory 225. The interconnect220 is used to transmit programming instructions and application databetween each CPU 205, I/O device interface 210, storage 230, networkinterface 215, and memory 225. The interconnect 220 may include one ormore busses. The CPUs 205 may be a single CPU, multiple CPUs, or asingle CPU having multiple processing cores, in various embodiments. Inone embodiment, a processor 205 may be a digital signal processor (DSP).One or more processing elements 235 (described herein) may be stored inthe memory 225. A processing element 235 may include one or more streamoperators 240 (described herein). In one embodiment, a processingelement 235 is assigned to be executed by only one CPU 205, although inother embodiments the stream operators 240 of a processing element 235may include one or more threads that are executed on two or more CPUs205. The memory 225 is generally included to be representative of arandom access memory (RAM), e.g., Static Random Access Memory (SRAM),Dynamic Random Access Memory (DRAM), or Flash. The storage 230 isgenerally included to be representative of a non-volatile memory, suchas a hard disk drive, solid state device (SSD), or removable memorycards, optical storage, flash memory devices, network attached storage(NAS), or connections to storage area network (SAN) devices, or otherdevices that may store non-volatile data. The network interface 215 isconfigured to transmit data via the communications network 120,according to various embodiments.

A stream computing application may include one or more stream operators240 that may be compiled into a “processing element” container 235. Thememory 225 may include two or more processing elements 235, with eachprocessing element having one or more stream operators 240. Each streamoperator 240 may include a portion of code that processes tuples flowinginto a processing element. The stream operators can then output thetuples to other stream operators 240 in the same processing element, inother processing elements, or in both the same and other processingelements in a stream computing application. Processing elements 235 maypass tuples to other processing elements that are on the same computenode 110 or on other compute nodes that are accessible viacommunications network 120. For example, a processing element 235 oncompute node 110A may output tuples to a processing element 235 oncompute node 110B.

The storage 230 may include a buffer 260. Although shown as being instorage, the buffer 260 may be located in the memory 225 of the computenode 110 or in a combination of both memories. Moreover, storage 230 mayinclude storage space that is external to the compute node 110, such asin a cloud.

The compute node 110 may include one or more operating systems 262. Anoperating system 262 may be stored partially in memory 225 and partiallyin storage 230. Alternatively, an operating system may be storedentirely in memory 225 or entirely in storage 230. The operating systemprovides an interface between various hardware resources, including theCPU 205, and processing elements and other components of the streamcomputing application. In addition, an operating system provides commonservices for application programs, such as providing a time function.

FIG. 3 is a more detailed view of the management system 105 of FIG. 1according to some embodiments. The management system 105 may include,without limitation, one or more processors (CPUs) 305, a networkinterface 315, an interconnect 320, a memory 325, and a storage 330. Themanagement system 105 may also include an I/O device interface 310connecting I/O devices 312, e.g., keyboard, display, stylus,touchscreen, and mouse devices, to the management system 105.

Each CPU 305 retrieves and executes programming instructions stored inthe memory 325 or storage 330. Similarly, each CPU 305 stores andretrieves application data residing in the memory 325 or storage 330.The interconnect 320 is used to move data, such as programminginstructions and application data, between the CPU 305, I/O deviceinterface 310, storage unit 330, network interface 315, and memory 325.The interconnect 320 may be one or more busses. The CPUs 305 may be asingle CPU, multiple CPUs, or a single CPU having multiple processingcores in various embodiments. In one embodiment, a processor 305 may bea DSP. Memory 325 is generally included to be representative of a RAM,e.g., SRAM, DRAM, or Flash. The storage 330 is generally included to berepresentative of a non-volatile memory, such as a hard disk drive,solid state device (SSD), removable memory cards, optical storage, Flashmemory devices, NAS, connections to storage area-network (SAN) devices,or the cloud. The network interface 315 is configured to transmit datavia the communications network 120.

The memory 325 may store a stream manager 134. The stream manager 134may monitor one or more operators operating within the streamsenvironment. The memory 325 may store a fusion manager 140. The fusionmanager 140 may monitor the workloads of the operators within thestreams environment. The operators can be combined into processingelements, which may accept tuples, and allow the operators to performoperations on the tuples. The fusion manager 140 may determine ifoperators can be fused to combine one or more operators into aprocessing element. Additionally, the storage 330 may store an operatorgraph 132. The operator graph 132 may define how tuples are routed toprocessing elements 235 (FIG. 2) for processing.

The management system 105 may include one or more operating systems 332.An operating system 332 may be stored partially in memory 325 andpartially in storage 330. Alternatively, an operating system may bestored entirely in memory 325 or entirely in storage 330. The operatingsystem provides an interface between various hardware resources,including the CPU 305, and processing elements and other components ofthe stream computing application. In addition, an operating systemprovides common services for application programs, such as providing atime function.

FIG. 4 is a more detailed view of the development system 102 of FIG. 1according to some embodiments. The development system 102 may include,without limitation, one or more processors (CPUs) 405, a networkinterface 415, an interconnect 420, a memory 425, and storage 430. Thedevelopment system 102 may also include an I/O device interface 410connecting I/O devices 412, e.g., keyboard, display, stylus,touchscreen, and mouse devices, to the development system 102.

Each CPU 405 retrieves and executes programming instructions stored inthe memory 425 or storage 430. Similarly, each CPU 405 stores andretrieves application data residing in the memory 425 or storage 430.The interconnect 420 is used to move data, such as programminginstructions and application data, between the CPU 405, I/O deviceinterface 410, storage unit 430, network interface 415, and memory 425.The interconnect 420 may be one or more busses. The CPUs 405 may be asingle CPU, multiple CPUs, or a single CPU having multiple processingcores in various embodiments. In one embodiment, a processor 405 may bea DSP. Memory 425 is generally included to be representative of a RAM,e.g., SRAM, DRAM, or Flash. The storage 430 is generally included to berepresentative of a non-volatile memory, such as a hard disk drive,solid state device (SSD), removable memory cards, optical storage, flashmemory devices, network attached storage (NAS), connections to storagearea-network (SAN) devices, or to the cloud. The network interface 415is configured to transmit data via the communications network 120.

The development system 102 may include one or more operating systems432. An operating system 432 may be stored partially in memory 425 andpartially in storage 430. Alternatively, an operating system may bestored entirely in memory 425 or entirely in storage 430. The operatingsystem provides an interface between various hardware resources,including the CPU 405, and processing elements and other components ofthe stream computing application. In addition, an operating systemprovides common services for application programs, such as providing atime function.

The memory 425 may store a compiler 136. The compiler 136 compilesmodules, which include source code or statements, into the object code,which includes machine instructions that execute on a processor. In oneembodiment, the compiler 136 may translate the modules into anintermediate form before translating the intermediate form into objectcode. The compiler 136 may output a set of deployable artifacts that mayinclude a set of processing elements and an application descriptionlanguage file (ADL file), which is a configuration file that describesthe stream computing application. In some embodiments, the compiler 136may be a just-in-time compiler that executes as part of an interpreter.In other embodiments, the compiler 136 may be an optimizing compiler. Invarious embodiments, the compiler 136 may perform peepholeoptimizations, local optimizations, loop optimizations, inter-proceduralor whole-program optimizations, machine code optimizations, or any otheroptimizations that reduce the amount of time required to execute theobject code, to reduce the amount of memory required to execute theobject code, or both. The output of the compiler 136 may be representedby an operator graph, e.g., the operator graph 132.

The compiler 136 may also provide the application administrator with theability to optimize performance through profile-driven fusionoptimization. Fusing operators may improve performance by reducing thenumber of calls to a transport. While fusing stream operators mayprovide faster communication between operators than is available usinginter-process communication techniques, any decision to fuse operatorsmay balance the benefits of distributing processing across multiplecompute nodes with the benefit of faster inter-operator communications.The compiler 136 may automate the fusion process to determine how tobest fuse the operators to be hosted by one or more processing elements,while respecting user-specified constraints. This may be a two-stepprocess, including compiling the application in a profiling mode andrunning the application, then re-compiling and using the optimizerduring this subsequent compilation. The end result may, however, be acompiler-supplied deployable application with an optimized applicationconfiguration.

FIG. 5 illustrates an operator graph 532 for a stream computingapplication beginning from a source 502 through to one or more sinks504, 506, according to some embodiments. This flow from source 502 tothe one or more sinks may also be generally referred to herein as anexecution path. In addition, a flow from one processing element toanother may be referred to as an execution path in various contexts.Although FIG. 5 is abstracted to show connected processing elementsPE1-PE10, the operator graph 532 may include data flows between streamoperators 240 (FIG. 2) within the same or different processing elements.Typically, processing elements, such as processing element 235 (FIG. 2),receive tuples from the stream as well as output tuples into the stream(except for a sink—where the stream terminates, or a source 502—wherethe stream begins). While the operator graph 532 includes a relativelysmall number of components, an operator graph 532 may be much morecomplex and may include many individual operator graphs that may bestatically or dynamically linked together.

The example operator graph 532 may be managed by a management system505. The management system 505 may include a stream manager 534, and afusion manager 540. The stream manager 534 may perform functions on thestream environment. Functions that the stream manager 534 performs mayinclude monitoring, recording, altering, and other various functions onthe streams environment and the tuples. The stream manager 534 mayfunction along with or be commutatively coupled to the fusion manager540. The fusion manager 540 may perform functions on the processingelements and the operators within the operator graph 532. The fusionmanager may monitor the streams environment, measure a workload of theoperators and the processing elements, determine thresholds of theworkload, determine fusion compatibilities of operators, and fuseoperators together on a processing element.

The example operator graph 532 shown in FIG. 5 includes ten processingelements (labeled as PE1-PE10) running on the compute nodes 110A-110D. Aprocessing element may include one or more stream operators fusedtogether to form an independently running process with its own processID (PID) and memory space. In cases where two (or more) processingelements are running independently, inter-process communication mayoccur using a “transport,” e.g., a network socket, a TCP/IP socket, orshared memory. Inter-process communication paths used for inter-processcommunications may be a critical resource in a stream computingapplication. However, when stream operators are fused together, thefused stream operators may use more rapid communication techniques forpassing tuples among stream operators in each processing element.

The operator graph 532 begins at a source 502 and ends at a sink 504,506. Compute node 110A includes the processing elements PE1, PE2, andPE3. Source 502 flows into the processing element PE1, which in turnoutputs tuples that are received by PE2 and PE3. For example, PE1 maysplit data attributes received in a tuple and pass some data attributesin a new tuple to PE2, while passing other data attributes in anothernew tuple to PE3. As a second example, PE1 may pass some received tuplesto PE2 while passing other tuples to PE3. Tuples that flow to PE2 areprocessed by the stream operators contained in PE2, and the resultingtuples are then output to PE4 on compute node 110B. Likewise, the tuplesoutput by PE4 flow to operator sink PE6 504. Similarly, tuples flowingfrom PE3 to PE5 also reach the operators in sink PE6 504. Thus, inaddition to being a sink for this example operator graph 532, PE6 couldbe configured to perform a join operation, combining tuples receivedfrom PE4 and PE5. This example operator graph 532 also shows tuplesflowing from PE3 to PE7 on compute node 110C, which itself shows tuplesflowing to PE8 and looping back to PE7. Tuples output from PE8 flow toPE9 on compute node 110D, which in turn outputs tuples to be processedby operators in a sink processing element, for example PE10 506.

Processing elements 235 (FIG. 2) may be configured to receive or outputtuples in various formats, e.g., the processing elements or streamoperators could exchange data marked up as XML documents. Furthermore,each stream operator 240 within a processing element 235 may beconfigured to carry out any form of data processing functions onreceived tuples, including, for example, writing to database tables orperforming other database operations such as data joins, splits, reads,etc., as well as performing other data analytic functions or operations.

The stream manager 534 of FIG. 1 may be configured to monitor a streamcomputing application running on compute nodes, e.g., compute nodes110A-110D, as well as to change the deployment of an operator graph 532.The stream manager 134 may move processing elements from one computenode 110 to another, for example, to manage the processing loads of thecompute nodes 110A-110D in the computing infrastructure 100. Further,stream manager 134 may control the stream computing application byinserting, removing, fusing, un-fusing, or otherwise modifying theprocessing elements and stream operators (or what tuples flow to theprocessing elements) running on the compute nodes 110A-110D.

Because a processing element may be a collection of fused streamoperators, it is equally correct to describe the operator graph as oneor more execution paths between specific stream operators. Theprocessing elements may include one or more stream operators operatingwithin the processing element. The processing elements may includeexecution paths to different stream operators within the same processingelement. According to FIG. 5, an embodiment illustrates execution pathsbetween processing elements for the sake of clarity.

FIGS. 6A and 6B illustrate the fusion of two processing elements into asingle processing element. A streams environment operates as tuples movewithin an operator graph situated to perform a series of operations. Theseries of operations may be combined to form an application based uponthe use of the streams environment. The fusion of the two processingelements may be determined by the programming instructions within thecode of the operators.

In FIG. 6A a streams environment of one or more operators isillustrated. The streams environment may include one or more operatorsthat may include a source 610, and sink 612. Between the source 610 andthe sink 612, one or more processing elements are ordered including afirst processing element (PE1) 631, a second processing element (PE2)632, a third processing element (PE3) 633, a fourth processing element(PE4) 634, and a fifth processing element (PE5) 635. The five processingelements may include one or more operators performing operations upon astream of tuples passing though the operator graph from the source 610to the sink 612.

A fusion manager 650 may be used to determine if one of the fiveprocessing elements may be fused. For a processing element to be fusedwith another processing element the programming instructions, of each ofthe one or more operators within each of the two or more processingelements, may include the language allowing the processing elements tobe fused. For example, if the programming instructions of the one ormore operators within the PE3 633 and the one or more operators withinthe PE4 634 contain the programming instructions to be fused, then thePE3 and PE4 may be fused.

In FIG. 6B, a streams environment of a plurality of operators isillustrated after fusion of the plurality of operators of two processingelements. The fusion manager 650 fused the two processing elements PE3and the PE4 (FIG. 6A) into a single sixth processing element (PE6) 636.The fusion of the PE3 and the PE4 into PE6 636 may include taking theplurality of operators of PE3 and the plurality of operators of PE4 andcombining the operators into a single processing element the PE6 636.The other three processing elements the PE1 631, the PE2 632, and thePE5 635 may remain the same after combining the PE3 and the PE4. Forexample, the PE3 may contain three operators and the PE4 may contain twooperators. The programming instructions of the three operators of thePE3 and the two operators of PE4 may include language instructing thefusion manager 650 to which operators the monitored operator may fuse.If all three of the operators within the PE3 may fuse with the twooperators of the PE4, then the operators may fuse to create the PE6 636with five operators.

In various embodiments, the five operators of the PE6 636 may be laterdetermined to overload the PE6 and a plurality of the operators fiveoperators may need to be fused with another processing element. Theplurality of operators of the five operators can be distributed andfused to another processing element within the operator graph. If oneoperator of the five operators within PE6 636 needs to be distributedand fused with another processing element, the operator can be comparedto all of the operators within the PE1 631, PE2 632, and PE5 635. Ifmore than one of the processing elements are able to fuse with theoperator, then the optimal processing element is selected by the fusionmanager 650. For example, if PE1 631 and PE5 635 are able to accept theoperator from PE6 636, then the fusion manager 650 may select theoptimal processing element. The optimal processing element may include aprocessing element with the higher available processing power, or aprocessing element that has a similar operator to the operator to befused. The fusion manager 650 may fuse the operator to the PE5 635 uponthe determination that the PE5 is the optimal processing unit whencompared to PE1 631.

In various embodiments, the operators of the PE3 and the PE4 may bedistributed between other operators instead of being combined togetherinto PE6 636. The distribution of the operators within the PE3 and thePE4 may require the operators to be determined, by the fusion manager650, if the operators can fuse with the other processing elements. Ifthe operators are able to fuse with a processing element within theoperator graph, then the fusion manager 650 may fuse the operator to theprocessing element. If the operators are not able to fuse with anotherprocessing element within the operator graph, then the fusion manager650 may create a new processing element for the operators. For example,the operators within the PE3 and the PE4 may include five operators. Ofthe five operators two of the operators may fuse with PE1 631, oneoperator may fuse with PE5 635, and two of the operators may not be ableto fuse with any of the processing elements. The two operators that wereunable to fuse with PE1 631, PE2 632, and PE5 635 may fuse together tocreate a new sixth processing element PE6 636.

In various embodiments, the workloads of the processing elements may bemonitored by the fusion manager 650. The monitoring may includedetermining if the workload of the processing elements being overloadedor underloaded. If the workload of one of the processing elements withinthe operator graph are overloaded or underloaded, then the fusionmanager 650 may distribute an operator from one of the processingelements to another. For example, if the workload of a PE1 631 isoverloaded, then the fusion manager 650 may distribute plurality ofoperators from the PE1 631 to another processing element. The pluralityof operators to be distributed can be determined by the fusion manager650 based on the programming instructions of the plurality of operators.The plurality of operators to be distributed can be determined by thefusion manager 650 by the workload associated with that operator withinthe PE1 631. The fusion manager 650 may select the plurality ofoperators to distribute to another processing element and fuse theplurality of operators with another processing element. For example, theprocessing element to be fused may be PE2 632. The fusion manager 650can de-couple the plurality of operators to be fused from PE1 631, andfuse the plurality of operators with PE2.

FIGS. 7A and 7B, illustrate the fusion of two processing elements byremoving an operator from a processing element and fusing the operatorwith another processing element. A streams environment operates astuples move within an operator graph situated to perform a series ofoperations. The series of operations may be combined to form anapplication based upon the use of the streams environment.

In FIG. 7A, illustrated is three processing elements each with pluralityof operators positioned between a source and a sink. The source 710reads data from a first storage medium and sends the data in the form oftuples into the streams environment to be processed by the threeprocessing elements within the operator graph. The sink 712 receivestuples that have been processed by the three processing elements andwrites the tuples in the form of data onto a second storage medium. Thethree processing elements may include a first processing element (PE1)731, a second processing element (PE2) 732, and a third processingelement (PE3) 733. A fusion manager 750 may monitor the three processingelements as tuples pass through the processing elements from the source710 to the sink 712.

The three processing elements may include a plurality of operators thatperform operations upon tuples as they pass through the processingelement. The PE1 731 includes two operators a first operator (OP1) 721,and a second operator (OP2) 722. The PE2 732 includes on operator athird operator (OP3) 723. The PE3 733 includes two operators a fourthoperator (OP4) 724, and a fifth operator (OP5) 725. Each of theoperators may perform an operation on each tuple entering the processingelement. Once each of the plurality of operators performs an operationon the tuple within the processing element, the tuple may move to thenext processing element within the operator graph until the tuplereaches the sink 712. For example, the PE1 731 may receive a tuple fromthe source. The PE1 731 may contain OP1 721 and OP2 722 performs theirrespective operations upon the tuple. The OP1 721 may perform anoperation on the tuple, and then OP2 722 may perform an operation on thetuple. The OP2 722 may perform an operation on the tuple, and then OP1721 may perform an operation on the tuple. The OP1 721 and OP2 722 mayboth perform operations upon the tuple simultaneously on the tuple.After both of the operations of OP1 721 and OP2 722 are performed on thetuple, the PE1 731 may send the tuple to PE2 732 to perform operationsupon the tuple.

A fusion manager 750 may monitor the operator graph as the tuples passthrough the processing elements including PE1 731, the PE2 732, and thePE3 733. The fusion manager 750 may monitor for the workloads of theprocessing elements and determine if the workloads of the processingelements are overloaded or underloaded. For example, the fusion manager750 may determine that workload of the PE2 732 containing OP3 723 isunderloaded. The fusion manager 750 may look at the programminginstructions of other operators within the streams environment anddetermine which processing element the operator may fuse. Theprogramming instructions of OP3 723 can be compared to the programminginstructions of the OP1 721, the OP2 722, the OP4 724, and the OP5 725.If the OP3 723 is not able to fuse with the OP1 721, or the OP2 722,then the OP3 may not be able to fuse with PE1 731. If the OP3 723 isable to fuse with OP4 724, and OP5 725, then the OP3 may be fused withPE3 733.

In FIG. 7B, illustrated is a fusion of an operator from a secondprocessing element to a third processing element. The second processingelement (PE2) (FIG. 7A) has been de-coupled from the stream environmentand the third operator (OP3) 723 that was contained within PE2 has beenfused with a third processing element (PE3) 733. Now within the streamsenvironment, according to an embodiment, two processing elements areoperating on tuples as they pass from the source 710 to the sink 712.

After the OP3 723 has fused with the PE3 733, a fusion manager 750 maymonitor the workload of the processing elements within the streamsenvironment. After fusing an operator from a processing element with anew processing element the workload of both of the processing elementsmay change. For example, the PE3 733 has fused the OP3 723 alongside theOP4 724 and the OP5 725. The increase in the number of operators withinthe PE3 733 may increase the workload of PE3 when compared to beforefusing the OP3 723 to the PE3. Since all of operators from the PE2 werede-coupled and fused with PE3 733, PE2 may be removed from the operatorgraph, reducing the workload of PE2. The workload of PE2, when removed,may be zero, possibly removing the need for the computer processor to berunning the PE2. When the computer processor running the PE2 is nolonger needed, the computer processor may be used for another task.

In various embodiments, the OP3 723 may fuse with either the PE1 731 orthe PE3 733. If both the PE1 731 and the PE3 733 are able to fuse OP3723, then the optimal processing element may be chosen to fuse with OP3.The optimal processing element may be determined by the fusion manager750. The optimal processing element may be determined by comparing theworkloads of the PE1 731 and the PE3 733. The optimal processing elementmay also be determined based on the configuration of the operator graph.The fusion manager 750 can determine, according to various embodiments,which processing element has a lower workload when compared to the otherprocessing elements. For example, the PE3 732 may have a lower workloadwhen compared to the PE1 731 and OP3 723 may be fused with the PE3. Theoptimal processing element may be determined by which processing elementhas the most related operators. For example, if neither the OP1 721 northe OP2 722 of the PE1 731 are related to the OP3 723, then OP3 may notfuse with PE1. If the OP4 724 of the PE3 733 is related to the OP3 723,then as long as the OP5 725 of the PE3 733 is able to fuse alongside theOP3 723, then the OP3 may fuse with the PE3 733.

In various embodiments, the fusion manager 750 may also monitor storedhistorical information of previous runs of the streams environment. Whendetermining the fusion of an operator, the fusion manager 750 may needto decide between two or more other processing elements. The storedhistorical information may be used to determine with which processingelement to fuse the operator. For example, the stored historicalinformation may be used to determine if running two processing elementswith similar operators may waste computational power. For example, ifOP3 723 is similar to OP4 724, then may be advantageous to fuse OP3 withthe PE3 733 as long as the OP5 725 is able to fuse with OP3.

In FIG. 8 illustrated is a flowchart of the fusion of an operator fromone processing element to another processing element. The operator maybe transferred from a first processing element to a second processingelement with a plurality of operators, and fused with the secondprocessing element. For the operator to be fused with the secondprocessing element, each of the plurality of operators within the secondprocessing element may have to be able to fuse with the operator. Forexample, a first processing element may be coupled with a firstoperator, and a second processing element be coupled with contain asecond operator.

In operation 802, a first processing element and a second processingelement are selected. The first processing element may contain a firstoperator coupled with the first processing element. The secondprocessing element may contain a second operator coupled with the secondprocessing element.

In operation 804, a computer processor consumption or workload of thefirst processing element is monitored. A workload of the secondprocessing element may be monitored. The monitoring of the workload ofthe first processing element and the second processing element may bemeasured and recorded by a fusion manager. To measure the workload ofthe first processing element and the second processing element thefusion manager may measure the workload or consumption of a computerprocessor. For example, the fusion manager may measure the workload of afirst processing element, and the workload of a second processingelement. The workload of the first processing element may include theworkload of a first operator within the first processing element. Theworkload of the second processing element may include the workload of asecond operator within the second processing element.

In operation 806, a threshold of a workload of computer processors thatthe first operator and the second operator are operating upon isdetermined. The threshold may include an upper threshold or a lowerthreshold of the workload of the computer processors. The upperthreshold and the lower threshold may be used to determine if a computerprocessor is overloaded or underloaded. If the computer processor is notoverloaded or underloaded, then the fusion may not be and the flowchartmay progress to operation 808. The thresholds may be adjustable. Thethreshold may be used to inform a user that the processing element isoverloaded or underloaded. If the workload of the first processingelement has reached a threshold, then the flowchart may process tooperation 810. For example, the first operator of a first processingelement may be operating on a first computer processor. If the workloadof the first computer processor reaches a threshold, then the thresholdmay be a first threshold. The first threshold may be determined by afusion manager. The fusion manager may process the flowchart tooperation 810, which sends instructions on how to fuse the operators.

If a processor containing a processing element with an operator isoverloaded, then the processing element may attempt to fuse an operatorwithin the processing element to another processing element. Forexample, a first processing element has a first operator. The workloadof the first processing element may be overloaded, causing the workloadof the first processing element to reach a first threshold. The firstoperator of the first processing element may be de-coupled and fused toa second processing element to reduce the workload of the firstprocessing element.

If a processor with a processing element is underloaded, then anoperator of another processing element may be de-coupled and fused withthe processing element of the processor. For example, a first processingelement has a first operator and a second processing element has asecond processing element. The workload of the first processing elementmay be underloaded, causing the workload of the first processing elementto reach a first threshold. The second operator of the second processingelement may be de-coupled and fused to the first processing element toincrease the workload of the first processing element.

In various embodiments, the operators may be fused on the determinationthat the fusion may increase a workload efficiency even if the firstthreshold has not been reached. If the first threshold has not beenreached but the workload efficiency may be increased, then the firstprocessing element may be fused with the second processing element.

In operation 808, the operators remain unfused. If the first thresholdhas not been reached by the processing element, then the operatorsremain unfused. For example, if the first processing element has notreached the threshold, then a first operator of the first processingelement may not be fused to another processing element.

In operation 810, the fusion of a first operator within the firstprocessing element and a second operator within the second processingelement is determined. To determine if the first operator and the secondoperator may be fused, programming instructions may be used. Theprogramming instructions of the first operator and the programminginstructions of the second operator may be compared to determine if theoperators may be fused. The programming instructions of the firstoperator may include fusion instructions of the first operator. Theprogramming instructions of the second operator may include fusioninstructions of the second operator. If the programming instructions ofthe first operator and the programming instructions of the secondoperator may determine that the first operator may be fused with thesecond operator, then the flowchart may progress to operation 812. Theprogramming instructions of the first operator and the programminginstructions of the second operator may determine that the firstoperator and the second operator are in a same class. The class mayinclude a type of operator. If the programming instructions of the firstoperator and the programming instructions of the second operator maydetermine that the first operator may not be fused with the secondoperator, then the flowchart may progress to operation 818.

In various embodiments, the second processing element may contain morethan one operator that determines if the first operator and the secondoperator may fuse. For example, the second processing element maycontain a third operator. The third operator may include programminginstructions that may include the fusion instructions of the thirdoperator. If the programming instructions of the first operator and thethird operator may determine that the first operator may not be fusedwith the third operator, then the flow chart may progress to operation818. Even if the programming instructions of the first operator and theprogramming instructions of the second operator determine that the firstoperator and the second operator may be fused, the programminginstructions of the third operator included within the second processingelement may prevent the first operator and the second operator fromfusing.

In operation 812, the fusion manager may fuse the first operator withthe second operator. The first operator may be fused with the secondoperator on the second processing element. The second processing elementmay receive the first operator from the first processing element andfuse the first operator with the second operator. The fusion may includethe first operator and the second operator performing independentoperations on tuples as they are within the second processing element.For example, a tuple may enter the second processing element. The tupleenters the processing element, the first operator and the secondoperator perform operations on the tuple, and the tuple exits the secondprocessing element.

In various embodiments, the first operator and the second operator maybe fused on the first processing element. The first processing elementmay receive the second operator from the second processing element andfuse the first operator with the second operator.

In various embodiments, the fusion of the first operator and the secondoperator on the second processing element requires a pause of thestreams environment. For example, if the first operator is to bede-coupled from the first processing element, the tuple flow enteringthe first processing element may need to be paused to prevent tuplesfrom not being processed by the first operator before the first operatoris moved to the second processing element. A pause may include holdingtuples from entering a processing element that has the pause placedbefore. If the first processing element is located upstream of thesecond processing element, then the pause can be placed before the firstprocessing element. If the second processing element is located upstreamof the first processing element, then the pause can be placed before thesecond processing element. The pausing of the tuple flow may bemaintained until the first operator is de-coupled from the firstprocessing element, and fused with the second processing element. Afterthe first operator is fused with the second processing element, thepause may be removed and the tuple flow may be restored.

In operation 814, workload is monitored of the first processing elementand the second processing element and the workload may be used todetermine if the fusion has increased the efficiency of the firstprocessing element and the second processing element. The efficiency mayinclude the workload efficiency. Workload efficiency may be determinedby the computational power required or computer process consumption ofthe workload. A computer processor consumption or workload of the firstprocessing element and the workload of the second processing element maybe used to determine if the fusion of the first operator and the secondoperator increased or decreased the efficiency of the streamsenvironment. Increasing or decreasing the efficiency of the streamsenvironment may include the efficiency of the first processing element,the second processing element, or the streams environment as a whole.For example, if adding the workload of the first operator increased theworkload of the second processing element but did not overload theworkload of the second processing element, then the fusion may haveincreased the efficiency of the second processing element. The fusionmay also decrease the workload of the first processing element; if thefusion does not under load the workload of the first processing element,then the fusion may have increased the efficiency of the streamsenvironment as a whole. If the fusion increases the efficiency of thestreams environment, then the flowchart may progress to operation 816.In another example, if adding the workload of the first operator to thesecond processing element overloads the workload of the secondprocessing element, then the fusion may have decreased the workloadefficiency of the second processing element. If the fusion decreases theefficiency of the second processing element, then the flow chart mayprogress to operation 818.

In various embodiments, the fusion may increase the efficiency of thefirst processing element, but decrease the efficiency of the secondprocessing element. For example, the fusion may prevent the firstoperator from overloading the first processing element, but the fusioncauses the second processing element to be overloaded. The fusionmanager may choose which processing element is the least overloaded whenfused with the first processing element. For example, if the firstprocessing element with the first operator is 10% overloaded and thefusion of the first operator causes the second processing element to be5% overloaded, then the fusion manager may fuse the operator with thesecond processing element.

In various embodiments, the removal of the first operator from the firstprocessing element may include removing all of the operators within thefirst processing element. If all of the operators within the firstprocessing element are de-coupled, then the workload first processingelement may be zero. Since the workload is zero the underloaded workloaddetermination is not considered when determining if more operatorsshould be fused with the first processing element. If the workload ofthe first processing element is zero, then the processing element may beremoved from the streams environment.

In various embodiments, determining the efficiency may include athreshold of the workload of the computer processors. The threshold mayinclude an upper threshold or a lower threshold of the workload of thecomputer processors. The upper threshold and the lower threshold may beused to determine if a computer processor is overloaded or underloaded.If the computer processor is overloaded or underloaded, then the fusionmay have not increased the efficiency of the computer processor and theflowchart may progress to operation 818. For example, the fusion of thefirst operator and the second operator on the second processing elementmay cause a computer processor the second processing element isoperating on to be overloaded. If the computer processor becomesoverloaded by reaching the upper threshold, then the threshold mayinclude a second threshold of the workload. If the second threshold ofthe workload has been reached, then the fusion may have not increasedthe efficiency. If the fusion has not increased the efficiency, then thefirst operator and the second operator may be unfused in operation 818.

In operation 816, the first operator remains fused with the secondoperator on the second processing element. The determination of thefusion first operator with the second processing element increasing theefficiency of the streams environment may result in the fusion.

In operation 818, the first operator is unfused with the second operatoron the second processing element. The determination of the fusion firstoperator with the second processing element decreasing the efficiency ofthe streams environment may result in the fusion being reverted orunfused. The first operator may be fused with the first processingelement to return the streams environment to the original configuration.

In various embodiments, the fusion operation 808 may be tested in a teststreams environment. A copy of the operator graph of the actual streamsenvironment being monitored by the fusion manager may be copied andtested to determine if the fusion of the first operator to the secondprocessing element will increase the efficiency of the test streamsenvironment. The testing may proceed within the test streams environmentas within the flow chart, but the fusion within the operator graph maynot occur unless the test streams environment determines that the fusionincreases the efficiency of the tested streams environment. In operation812, the tested streams environment may apply the fusion in the operatorgraph to conclude the tested streams environment. For example, a teststreams environment may be created as a copy of the operator graph ofthe actual streams environment. The copy may be tested using a previousrun performed upon the streams environment. If the fusion of the firstoperator to the second operator within the second processing elementincreases the efficiency of the tested streams environment, then thefirst operator can be fused with second operator within the operatorgraph of the actual streams environment.

The present invention may be a system, a method, and/or a computerprogram product. The computer program product may include a computerreadable storage medium (or media) having computer readable programinstructions thereon for causing a processor to carry out aspects of thepresent invention.

The computer readable storage medium may be a tangible device that mayretain and store instructions for use by an instruction executiondevice. The computer readable storage medium may be, for example, but isnot limited to, an electronic storage device, a magnetic storage device,an optical storage device, an electromagnetic storage device, asemiconductor storage device, or any suitable combination of theforegoing. A non-exhaustive list of more specific examples of thecomputer readable storage medium includes the following: a portablecomputer diskette, a hard disk, a random access memory (RAM), aread-only memory (ROM), an erasable programmable read-only memory (EPROMor Flash memory), a static random access memory (SRAM), a portablecompact disc read-only memory (CD-ROM), a digital versatile disk (DVD),a memory stick, a floppy disk, a mechanically encoded device such aspunch-cards or raised structures in a groove having instructionsrecorded thereon, and any suitable combination of the foregoing. Acomputer readable storage medium, as used herein, is not to be construedas being transitory signals per se, such as radio waves or other freelypropagating electromagnetic waves, electromagnetic waves propagatingthrough a waveguide or other transmission media (e.g., light pulsespassing through a fiber-optic cable), or electrical signals transmittedthrough a wire.

Computer readable program instructions described herein may bedownloaded to respective computing/processing devices from a computerreadable storage medium or to an external computer or external storagedevice via a network, for example, the Internet, a local area network, awide area network and/or a wireless network. The network may comprisecopper transmission cables, optical transmission fibers, wirelesstransmission, routers, firewalls, switches, gateway computers and/oredge servers. A network adapter card or network interface in eachcomputing/processing device receives computer readable programinstructions from the network and forwards the computer readable programinstructions for storage in a computer readable storage medium withinthe respective computing/processing device.

Computer readable program instructions for carrying out operations ofthe present invention may be assembler instructions,instruction-set-architecture (ISA) instructions, machine instructions,machine dependent instructions, microcode, firmware instructions,state-setting data, or either source code or object code written in anycombination of one or more programming languages, including an objectoriented programming language such as Smalltalk, C++ or the like, andconventional procedural programming languages, such as the “C”programming language or similar programming languages. The computerreadable program instructions may execute entirely on the user'scomputer, partly on the user's computer, as a stand-alone softwarepackage, partly on the user's computer and partly on a remote computeror entirely on the remote computer or server. In the latter scenario,the remote computer may be connected to the user's computer through anytype of network, including a local area network (LAN) or a wide areanetwork (WAN), or the connection may be made to an external computer(for example, through the Internet using an Internet Service Provider).In some embodiments, electronic circuitry including, for example,programmable logic circuitry, field-programmable gate arrays (FPGA), orprogrammable logic arrays (PLA) may execute the computer readableprogram instructions by utilizing state information of the computerreadable program instructions to personalize the electronic circuitry,in order to perform aspects of the present invention.

Aspects of the present invention are described herein with reference toflowchart illustrations and/or block diagrams of methods, apparatus(systems), and computer program products according to embodiments of theinvention. It will be understood that each block of the flowchartillustrations and/or block diagrams, and combinations of blocks in theflowchart illustrations and/or block diagrams, may be implemented bycomputer readable program instructions.

These computer readable program instructions may be provided to aprocessor of a general purpose computer, special purpose computer, orother programmable data processing apparatus to produce a machine, suchthat the instructions, which execute via the processor of the computeror other programmable data processing apparatus, create means forimplementing the functions/acts specified in the flowchart and/or blockdiagram block or blocks. These computer readable program instructionsmay also be stored in a computer readable storage medium that may directa computer, a programmable data processing apparatus, and/or otherdevices to function in a particular manner, such that the computerreadable storage medium having instructions stored therein comprises anarticle of manufacture including instructions which implement aspects ofthe function/act specified in the flowchart and/or block diagram blockor blocks.

The computer readable program instructions may also be loaded onto acomputer, other programmable data processing apparatus, or other deviceto cause a series of operational steps to be performed on the computer,other programmable apparatus or other device to produce a computerimplemented process, such that the instructions which execute on thecomputer, other programmable apparatus, or other device implement thefunctions/acts specified in the flowchart and/or block diagram block orblocks.

The flowchart and block diagrams in the Figures illustrate thearchitecture, functionality, and operation of possible implementationsof systems, methods, and computer program products according to variousembodiments of the present invention. In this regard, each block in theflowchart or block diagrams may represent a module, segment, or portionof instructions, which comprises one or more executable instructions forimplementing the specified logical function(s). In some alternativeimplementations, the functions noted in the block may occur out of theorder noted in the figures. For example, two blocks shown in successionmay, in fact, be executed substantially concurrently, or the blocks maysometimes be executed in the reverse order, depending upon thefunctionality involved. It will also be noted that each block of theblock diagrams and/or flowchart illustration, and combinations of blocksin the block diagrams and/or flowchart illustration, may be implementedby special purpose hardware-based systems that perform the specifiedfunctions or acts or carry out combinations of special purpose hardwareand computer instructions.

What is claimed is:
 1. A system for fusing operators within a streamsenvironment, comprising: a processor; and a memory communicativelycoupled to the processor, wherein the memory comprises instructionswhich, when executed by the processor, cause the processor to: monitor astreams environment including a plurality of processing elementsoperating upon one or more computer processors, wherein the plurality ofprocessing elements include: a first processing element coupled with afirst operator which is instructed by a first programming instructions,and a second processing element coupled with a second operator which isinstructed by a second programming instructions; measure a workload ofthe first processing element; measure a workload of the secondprocessing element; determine if the workload of the first processingelement has reached a first threshold of the workload of the firstprocessing element; determine if the workload of the second processingelement has reached a second threshold of the workload of the secondprocessing element; compare the first programming instructions and thesecond programming instructions to determine whether the firstprogramming instructions and the second programming instructions arecompatible, wherein the first operator and the second operator aresusceptible to fusion when it is determined that the first programminginstructions and the second programming instructions are compatible; andin response to a determination that the workload of the first processingelement has reached the first threshold and the workload of the secondprocessing element has reached the second threshold and a determinationthat the first operator and the second operator are susceptible tofusion: de-couple the first operator from the first processing element,and fuse, the first operator to the second processing element.
 2. Thesystem of claim 1, wherein the first threshold of the workload of thefirst processing element is a lower threshold of the workload.
 3. Thesystem of claim 1, wherein the system is configured to: determine if theworkload of the first operator causes a workload of the secondprocessing element to reach a third threshold of the workload; andunfuse, in response to the third threshold of the workload, the firstoperator from the second processing element.
 4. The system of claim 1,wherein the system is further configured to: determine, in response tothe workload of the first processing element reaching the firstthreshold, a pause; pause one or more tuples from entering the streamsenvironment; de-couple the first operator from the first processingelement; fuse the first operator with the second processing element; andremove, in response to the fusing, the pause.
 5. The system of claim 1,wherein the programming instructions of the first operator includeinstructions on fusing with the second operator.
 6. The system of claim1, wherein the workload of the first processing element includes runtimestatistics of the first operator.
 7. The system of claim 6, wherein theruntime statistics further configure the system to: gather historicalinformation of tuple flow within the first operator; and display afusion of the first operator with the second processing element.
 8. Thesystem of claim 1, wherein the programming instructions of the firstoperator include a designation of a class of the first operator and theprogramming instructions of the second operator include a designation ofa class of the second operator.
 9. The system of claim 8, wherein thecomparing of the first programming instructions and the secondprogramming instructions to determine whether the first programminginstructions and the second programming instructions are compatibleincludes comparing the class of the first operator and the class of thesecond operator.
 10. A computer program product for fusing operatorswithin a streams environment comprising a computer readable storagemedium having a computer readable program stored therein, wherein thecomputer readable program, when executed on a computing device, causesthe computing device to: monitor a streams environment including aplurality of processing elements operating upon one or more computerprocessors, wherein the plurality of processing elements include: afirst processing element coupled with a first operator which isinstructed by a first programming instructions, and a second processingelement coupled with a second operator which is instructed by a secondprogramming instructions; measure a workload of the first processingelement; measure a workload of the second processing element; determineif the workload of the first processing element has reached a firstthreshold of the workload of the first processing element; determine ifthe workload of the second processing element has reached a secondthreshold of the workload of the second processing element; compare thefirst programming instructions and the second programming instructionsto determine whether the first programming instructions and the secondprogramming instructions are compatible, wherein the first operator andthe second operator are susceptible to fusion when it is determined thatthe first programming instructions and the second programminginstructions are compatible; and in response to a determination that theworkload of the first processing element has reached the first thresholdand the workload of the second processing element has reached the secondthreshold and a determination that the first operator and the secondoperator are susceptible to fusion: de-couple the first operator fromthe first processing element, and fuse, the first operator to the secondprocessing element.
 11. The computer program product of claim 10,wherein the first threshold of the workload of the first processingelement is a lower threshold of the workload.
 12. The computer programproduct of claim 10, wherein the computer readable instructions causethe computer to: determine if the workload of the first operator causesa workload of the second processing element to reach a third thresholdof the workload; and unfuse, in response to the third threshold of theworkload, the first operator from the second processing element.
 13. Thecomputer program product of claim 10, wherein the computer readableinstructions cause the computer to: determine, in response to theworkload of the first processing element reaching the first threshold, apause; pause one or more tuples from entering the streams environment;de-couple the first operator from the first processing element; fuse thefirst operator with the second processing element; and remove, inresponse to the fusing, the pause.
 14. The computer program product ofclaim 10, wherein the programming instructions of the first operatorinclude instructions on fusing with the second operator.
 15. Thecomputer program product of claim 10, wherein the programminginstructions of the first operator include a designation of a class ofthe first operator and the programming instructions of the secondoperator include a designation of a class of the second operator. 16.The computer program product of claim 15, wherein the comparing of thefirst programming instructions and the second programming instructionsto determine whether the first programming instructions and the secondprogramming instructions are compatible includes comparing the class ofthe first operator and the class of the second operator.